import request from '@/utils/request'

export function editUserInfo(data) {
  // return request.postJson('/user/appuser/updateUserInfo', data)
  return request.postJson('/jkbpuser/', data, { trCode: 'TO000228' })
}

export function getUserInfo(data) {
  // return request.postJson('/user/appuser/getUserInfo', data)
  return request.postJson('/jkbpuser/', data, { trCode: 'TO000223' })
}

export function sendVerifyCode(data) {
  // return request.postJson('/user/appuser/phone/message', data)
  return request.postJson('/jkbpuser/', data, { trCode: 'TO000225' })
}

export function changeMobile(data) {
  // return request.postJson('/user/appuser/resetPhone', data)
  return request.postJson('/jkbpuser/', data, { trCode: 'TO000226' })
}

export function createKaptcha() {
  // return request.postJson('/user/kaptcha/createKaptcha')
  return request.postJson('/jkbpuser/', {}, { trCode: 'TO000307' })
}

export function verifyKaptcha(data) {
  // return request.postJson('/user/kaptcha/verifyKaptcha', data)
  return request.postJson('/jkbpuser/', data, { trCode: 'TO000308' })
}

export function uploadAvatar(data) {
  return request.uploadFile('/user/appuser/uploadAvatar', data) // TO000229
}

export function generatePublicKey() {
  // return request.postBase('/jkbpuser/generateSecret/generatePublicKey', {},{trCode: 'TO000245',uniqueId: getUuid()})
  return request.postBase('/jkbpuser/', {}, { trCode: 'TO000245' })
}

// mockjs
export function login(data) {
  return request.post('/mock/user/login', data)
}

export function logout(data) {
  return request.post('/mock/user/logout', data)
}

